package com.jcli._java_swing_入门教程pdf.ch17;

import javax.swing.*;
import java.awt.*;

/**
 * @author li
 * @version 1.0
 * @belongsProject novel_20230923
 * @belongsPackage com.jcli._java_swing_入门教程pdf.ch17
 * @className JPanelDemo
 * @description TODO  JPanel案例
 * @createTime 2024-01-14  10:09
 */
public class JPanelDemo {
    public static void main(String[] args) {
        JFrame jf = new JFrame("第二个Java的GUI程序");
        jf.setBounds(300,100,400,300);
        JPanel jp = new JPanel();
        jp.setBackground(new Color(203, 165, 165));
        JLabel jl = new JLabel("这是一个放在JPanel上面的标签");
        jp.add(jl);
        jf.add(jp);
        // jp.setLayout(null);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jf.setVisible(true);
    }
}
